;Assembler header file for OSFSControl
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:01:38 2005
;Jonathan Coxhead, jonathan@doves.demon.co.uk, 5 Sept 1995

        [       :LNOT: :DEF: OSFSControl_Hdr
        GBLS    OSFSControl_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_FileSwitch
        GBLS    Get_FileSwitch
        ]
        [       :LNOT: :DEF: FileSwitch_Hdr
Get_FileSwitch                  SETS    "GET oslib/FileSwitch.Hdr"
        |
Get_FileSwitch                  SETS    ""
        ]
        $Get_FileSwitch

;Symbols for constants
OSFSControl_OptRestoreDefault   *       0
OSFSControl_OptMessageLevel     *       1
OSFSControl_OptBootAction       *       4
OSFSControl_CopyRecurse         *       &1
OSFSControl_CopyForce           *       &2
OSFSControl_CopyGivenTimes      *       &4
OSFSControl_CopyConfirm         *       &8
OSFSControl_CopyVerbose         *       &10
OSFSControl_CopyQuick           *       &20
OSFSControl_CopyPrompt          *       &40
OSFSControl_CopyDelete          *       &80
OSFSControl_CopyAllowPrint      *       &100
OSFSControl_CopyNoAttributes    *       &200
OSFSControl_CopyStamp           *       &400
OSFSControl_CopyStructure       *       &800
OSFSControl_CopyNewer           *       &1000
OSFSControl_CopyGivenDescriptor *       &2000
OSFSControl_CopyLook            *       &4000
OSFSControl_WipeRecurse         *       &1
OSFSControl_WipeForce           *       &2
OSFSControl_WipeGivenTimes      *       &4
OSFSControl_WipeConfirm         *       &8
OSFSControl_WipeVerbose         *       &10
OSFSControl_WipeAllowPrint      *       &100
OSFSControl_CountRecurse        *       &1
OSFSControl_CountGivenTimes     *       &4
OSFSControl_CountConfirm        *       &8
OSFSControl_CountVerbose        *       &10
OSFSControl_CountAllowPrint     *       &100
OSFSControl_KindFree            *       &0
OSFSControl_KindAllocated       *       &1
OSFSControl_KindFound           *       &2
OSFSControl_KindSharable        *       &3
OSFSControl_DirCSD              *       &0
OSFSControl_DirPSD              *       &1
OSFSControl_DirURD              *       &2
OSFSControl_DirLib              *       &3

;Symbols for structure offsets and sizes
OSFSControl_Id                  *       4 ;abstract type
                                ^       0
OSFSControl_FSInfoBlock_name_offset #       Int
OSFSControl_FSInfoBlock_banner_offset #       Int
OSFSControl_FSInfoBlock_open_offset #       Int
OSFSControl_FSInfoBlock_get_bytes #       Int
OSFSControl_FSInfoBlock_put_bytes #       Int
OSFSControl_FSInfoBlock_args_offset #       Int
OSFSControl_FSInfoBlock_close_offset #       Int
OSFSControl_FSInfoBlock_file_offset #       Int
OSFSControl_FSInfoBlock_info    #       FileSwitch_FSInfo
OSFSControl_FSInfoBlock_func_offset #       Int
OSFSControl_FSInfoBlock_gbpb_offset #       Int
OSFSControl_FSInfoBlock_extra_info #       FileSwitch_FSExtraInfo
OSFSControl_FSInfoBlock         *       @

                                ^       0
                                #       Bits
OSFSControl_CopyFlags           *       @

                                ^       0
OSFSControl_Descriptor_addr     #       Ptr
OSFSControl_Descriptor_size     #       Int
OSFSControl_Descriptor          *       @

                                ^       0
                                #       Bits
OSFSControl_WipeFlags           *       @

                                ^       0
                                #       Bits
OSFSControl_CountFlags          *       @

                                ^       0
                                #       Int
OSFSControl_ObjectKind          *       @

                                ^       0
                                #       Int
OSFSControl_SpecialDir          *       @


;Symbols for SWI's and SWI reason codes
XOS_FSControl                   *       &20029
OS_FSControl                    *       &29

OSFSControl_Dir                 *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 -> dir_names (String)

OSFSControl_Lib                 *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 -> dir_names (String)

OSFSControl_StartApplication    *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 -> tail (String)
   ;  R2 = cao (pointer to data)
   ;  R3 -> command (String)

OSFSControl_Run                 *       &4
   ;Entry
   ;  R0 = &4
   ;  R1 -> file_names (String)

OSFSControl_Cat                 *       &5
   ;Entry
   ;  R0 = &5
   ;  R1 -> dir_names (String)

OSFSControl_Ex                  *       &6
   ;Entry
   ;  R0 = &6
   ;  R1 -> dir_names (String)

OSFSControl_LCat                *       &7
   ;Entry
   ;  R0 = &7
   ;  R1 -> dir_names (String)

OSFSControl_LEx                 *       &8
   ;Entry
   ;  R0 = &8
   ;  R1 -> dir_names (String)

OSFSControl_Info                *       &9
   ;Entry
   ;  R0 = &9
   ;  R1 -> file_names (String)

OSFSControl_Opt                 *       &A
   ;Entry
   ;  R0 = &A
   ;  R1 = opt (Int)
   ;  R2 = value (Int)

OSFSControl_SetTemporaryFS      *       &B
   ;Entry
   ;  R0 = &B
   ;  R1 -> file_name (String)
   ;Exit
   ;  R1 -> file_name_out (String)
   ;  R2 = old_fs_no (FileSwitch_FSNo)
   ;  R3 -> special (String)

OSFSControl_AddFS               *       &C
   ;Entry
   ;  R0 = &C
   ;  R1 -> module (data)
   ;  R2 = fs_info_offset (Int)
   ;  R3 = workspace (pointer to Void)

OSFSControl_LookupFS            *       &D
   ;Entry
   ;  R0 = &D
   ;  R1 = fs_no_or_name (OSFSControl_Id)
   ;  R2 = control_terminated (Bool)
   ;Exit
   ;  R1 = fs_no_out (FileSwitch_FSNo)
   ;  R2 = fs_found (Bool)

OSFSControl_SelectFS            *       &E
   ;Entry
   ;  R0 = &E
   ;  R1 = fs_no_or_name (OSFSControl_Id)

OSFSControl_BootFromFS          *       &F
   ;Entry
   ;  R0 = &F

OSFSControl_RemoveFS            *       &10
   ;Entry
   ;  R0 = &10
   ;  R1 -> fs_name (String)

OSFSControl_AddSecondaryFS      *       &11
   ;Entry
   ;  R0 = &11
   ;  R1 -> fs_name (String)
   ;  R2 -> secondary_name (String)
   ;  R3 = workspace (pointer to Void)

OSFSControl_ReadFileType        *       &12
   ;Entry
   ;  R0 = &12
   ;  R2 = file_type (Bits)
   ;Exit
   ;  R2 = name1 (Bits)
   ;  R3 = name2 (Bits)

OSFSControl_RestoreCurrent      *       &13
   ;Entry
   ;  R0 = &13

OSFSControl_ReadModuleBase      *       &14
   ;Entry
   ;  R0 = &14
   ;Exit
   ;  R1 -> module (data)
   ;  R2 = workspace (pointer to Void)

OSFSControl_ReadFSHandle        *       &15
   ;Entry
   ;  R0 = &15
   ;  R1 = file (OS_F)
   ;Exit
   ;  R1 = fs_handle (Int)
   ;  R2 = info_word (Int)

OSFSControl_ReadFSHandleW       *       &15
   ;Entry
   ;  R0 = &15
   ;  R1 = file (OS_FW)
   ;Exit
   ;  R1 = fs_handle (Int)
   ;  R2 = info_word (Int)

OSFSControl_Shut                *       &16
   ;Entry
   ;  R0 = &16

OSFSControl_Shutdown            *       &17
   ;Entry
   ;  R0 = &17

OSFSControl_Access              *       &18
   ;Entry
   ;  R0 = &18
   ;  R1 -> file_names (String)
   ;  R2 -> access (String)

OSFSControl_Rename              *       &19
   ;Entry
   ;  R0 = &19
   ;  R1 -> file_name (String)
   ;  R2 -> new_file_name (String)

OSFSControl_Copy                *       &1A
   ;Entry
   ;  R0 = &1A
   ;  R1 -> from (String)
   ;  R2 -> to (String)
   ;  R3 = flags (OSFSControl_CopyFlags)
   ;  R4 = start_load (Bits)
   ;  R5 = start_exec (Bits)
   ;  R6 = end_load (Bits)
   ;  R7 = end_exec (Bits)
   ;  R8 -> descriptor (OSFSControl_Descriptor)

OSFSControl_Wipe                *       &1B
   ;Entry
   ;  R0 = &1B
   ;  R1 -> file_names (String)
   ;  R3 = flags (OSFSControl_WipeFlags)
   ;  R4 = start_load (Bits)
   ;  R5 = start_exec (Bits)
   ;  R6 = end_load (Bits)
   ;  R7 = end_exec (Bits)

OSFSControl_Count               *       &1C
   ;Entry
   ;  R0 = &1C
   ;  R1 -> file_names (String)
   ;  R3 = flags (OSFSControl_CountFlags)
   ;  R4 = start_load (Bits)
   ;  R5 = start_exec (Bits)
   ;  R6 = end_load (Bits)
   ;  R7 = end_exec (Bits)
   ;Exit
   ;  R2 = byte_count (Int)
   ;  R3 = file_count (Int)

OSFSControl_ReadSecondaryFS     *       &1E
   ;Entry
   ;  R0 = &1E
   ;Exit
   ;  R1 -> module (data)
   ;  R2 = workspace (pointer to Void)

OSFSControl_FileTypeFromString  *       &1F
   ;Entry
   ;  R0 = &1F
   ;  R1 -> file_type_name (String)
   ;Exit
   ;  R2 = file_type (Bits)

OSFSControl_FileInfo            *       &20
   ;Entry
   ;  R0 = &20
   ;  R1 -> file_names (String)

OSFSControl_ReadFSName          *       &21
   ;Entry
   ;  R0 = &21
   ;  R1 = fs_no (FileSwitch_FSNo)
   ;  R2 = buffer (pointer to String)
   ;  R3 = size (Int)

OSFSControl_RegisterImageFS     *       &23
   ;Entry
   ;  R0 = &23
   ;  R1 -> module (data)
   ;  R2 = fs_info_offset (Int)
   ;  R3 = workspace (pointer to Void)

OSFSControl_DeregisterImageFS   *       &24
   ;Entry
   ;  R0 = &24
   ;  R1 = file_type (Bits)

OSFSControl_CanonicalisePath    *       &25
   ;Entry
   ;  R0 = &25
   ;  R1 -> path_name (String)
   ;  R2 = buffer (pointer to String)
   ;  R3 -> var (String)
   ;  R4 -> path (String)
   ;  R5 = size (Int)
   ;Exit
   ;  R5 = spare (Int)

OSFSControl_InfoToFileType      *       &26
   ;Entry
   ;  R0 = &26
   ;  R1 -> file_name (String)
   ;  R2 = load_addr (Bits)
   ;  R3 = exec_addr (Bits)
   ;  R4 = size (Int)
   ;  R5 = attr (FileSwitch_Attr)
   ;  R6 = obj_type (FileSwitch_ObjectType)
   ;Exit
   ;  R2 = file_type (Bits)

OSFSControl_URD                 *       &27
   ;Entry
   ;  R0 = &27
   ;  R1 -> dir_name (String)

OSFSControl_Back                *       &28
   ;Entry
   ;  R0 = &28

OSFSControl_DefectList          *       &29
   ;Entry
   ;  R0 = &29
   ;  R1 -> image_name (String)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)

OSFSControl_AddDefect           *       &2A
   ;Entry
   ;  R0 = &2A
   ;  R1 -> image_name (String)
   ;  R2 = offset (Int)

OSFSControl_NoDir               *       &2B
   ;Entry
   ;  R0 = &2B

OSFSControl_NoURD               *       &2C
   ;Entry
   ;  R0 = &2C

OSFSControl_NoLib               *       &2D
   ;Entry
   ;  R0 = &2D

OSFSControl_UsedSpaceMap        *       &2E
   ;Entry
   ;  R0 = &2E
   ;  R1 -> image_name (String)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)

OSFSControl_ReadBootOption      *       &2F
   ;Entry
   ;  R0 = &2F
   ;  R1 -> file_name (String)
   ;Exit
   ;  R2 = boot_option (Int)

OSFSControl_WriteBootOption     *       &30
   ;Entry
   ;  R0 = &30
   ;  R1 -> file_name (String)
   ;  R2 = boot_option (Int)

OSFSControl_FreeSpace           *       &31
   ;Entry
   ;  R0 = &31
   ;  R1 -> file_name (String)
   ;Exit
   ;  R0 = free (Int)
   ;  R1 = max (Int)
   ;  R2 = size (Int)

OSFSControl_NameDisc            *       &32
   ;Entry
   ;  R0 = &32
   ;  R1 -> file_name (String)
   ;  R2 -> disc_name (String)

OSFSControl_StampImage          *       &33
   ;Entry
   ;  R0 = &33
   ;  R1 -> file_name (String)
   ;  R2 = stamp_now (Bool)

OSFSControl_ObjectAtOffset      *       &34
   ;Entry
   ;  R0 = &34
   ;  R1 -> file_name (String)
   ;  R2 = offset (Int)
   ;  R3 = buffer (pointer to String)
   ;  R4 = size (Int)
   ;Exit
   ;  R2 = obj_kind (OSFSControl_ObjectKind)

OSFSControl_SetDir              *       &35
   ;Entry
   ;  R0 = &35
   ;  R1 -> path (String)
   ;  R2 = dir (OSFSControl_SpecialDir)
   ;  R3 -> fs_name (String)
   ;  R6 -> special (String)

OSFSControl_ReadDir             *       &36
   ;Entry
   ;  R0 = &36
   ;  R1 = buffer (pointer to String)
   ;  R2 = dir (OSFSControl_SpecialDir)
   ;  R3 -> fs_name (String)
   ;  R5 = size (Int)
   ;Exit
   ;  R5 = spare (Int)
   ;  R6 -> special (String)

OSFSControl_FreeSpace64         *       &37
   ;Entry
   ;  R0 = &37
   ;  R1 -> file_name (String)
   ;Exit
   ;  R0 = free_lo (Bits)
   ;  R1 = free_hi (Int)
   ;  R2 = max (Int)
   ;  R3 = disc_size_lo (Bits)
   ;  R4 = disc_size_hi (Bits)

OSFSControl_DefectList64        *       &38
   ;Entry
   ;  R0 = &38
   ;  R1 -> image_name (String)
   ;  R2 = buffer (pointer to data)
   ;  R3 = size (Int)

OSFSControl_AddDefect64         *       &39
   ;Entry
   ;  R0 = &39
   ;  R1 -> image_name (String)
   ;  R2 = offset_lo (Bits)
   ;  R3 = offset_hi (Int)

FSCV                            *       &F

UpCall_MediaNotPresent          *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = fs_no (FileSwitch_FSNo)
   ;  R2 -> media_name (String)
   ;  R3 = device_no (Int)
   ;  R4 = iteration_count (Int)
   ;  R5 = timeout (Int)
   ;  R6 -> media_type (String)
   ;Exit
   ;  R0 = changed (Int)

UpCall_MediaNotKnown            *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = fs_no (FileSwitch_FSNo)
   ;  R2 -> media_name (String)
   ;  R3 = device_no (Int)
   ;  R4 = iteration_count (Int)
   ;  R5 = timeout (Int)
   ;  R6 -> media_type (String)
   ;Exit
   ;  R0 = changed (Int)

UpCallFSControl_SetArgsSize     *       &200
   ;Entry
   ;  R0 = &3
   ;  R1 = f (OS_F)
   ;  R2 = size (Int)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &200

UpCallFSControl_SetArgsSizeW    *       &200
   ;Entry
   ;  R0 = &3
   ;  R1 = f (OS_FW)
   ;  R2 = size (Int)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &200

UpCallFSControl_Rename          *       &208
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R2 -> new_file_name (String)
   ;  R6 -> special (String)
   ;  R7 -> new_special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &208

UpCallFSControl_SetAttrString   *       &209
   ;Entry
   ;  R0 = &3
   ;  R1 -> file_name (String)
   ;  R2 -> attr (String)
   ;  R6 -> special (String)
   ;  R8 = fs_info (FileSwitch_FSInfo)
   ;  R9 = &209

UpCall_MediaSearchEnd           *       &4
   ;Entry
   ;  R0 = &4

UpCall_NewApplication           *       &100
   ;Entry
   ;  R0 = &100
   ;  R2 = cao (pointer to data)
   ;Exit
   ;  R0 = started (Bool)

        ]
        END
